<div id="content">
  <div class="row s_page_title">
    <sa-big-breadcrumbs [items]="['设备安装管理','设备已维修记录[客户]']" icon="fa fa-wrench"
      class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
  </div>

  <sa-widgets-grid>
    <div class="s_table">
      <div sa-widget [editbutton]="false" color="darken" class="clearfix">
        <header><span class="widget-icon"> <i class="fa fa-table"></i> </span>
          <h2>设备已维修记录[客户]</h2>
        </header>
        <div>
          <div class="widget-body no-padding">
            <div class="page-header clearfix s_table_opreation">
              <div class="left page-header-btn" style="width: calc(100% - 220px);">
                <sa-company-tree-car companyTreeId="companyTree" (companySelected)="companySelected($event)">
                </sa-company-tree-car>

                <div class="top_module top_module_box" >
									<span class="top_module_label module_text">车辆类型</span>
									<select class="top_module_select select2" select2 id="TcarTypeSelect2">
										<option value="">全部</option>
										<optgroup *ngFor="let item of carTypeList" [label]="item.label">
											<option *ngFor="let lis of item.children" [value]='lis.id'>{{lis.label}}</option>
										</optgroup>
									</select>
								</div>
                
                <div class="top_module top_module_box" style="min-width: auto;">
                  <span class="top_module_label module_text">故障现象</span>
                  <select name="faultPhenomenon" class="top_module_select" [(ngModel)]="faultPhenomenon" style="min-width: 110px;">
                    <option value="">全部</option>
                    <option value="" *ngFor="let item of pTypeList" [value]="item">{{item}}</option>
                  </select>
                </div>
                <div class="top_module top_module_box" style="min-width: auto;">
                  <span class="top_module_label module_text">维修内容</span>
                  <select name="" class="top_module_select" [(ngModel)]="repairContent" style="min-width: 110px;">
                    <option value="">全部</option>
                    <option *ngFor="let item of typeList" [value]="item">
                      {{item}}</option>
                  </select>
                </div>
                <!-- <div class="top_module top_module_box" style="min-width: auto;">
                  <span class="top_module_label module_text">时间类型</span>
                  <select name="" class="top_module_select" [(ngModel)]="dateType" style="min-width: 110px;">
                    <option value="1">创建时间</option>
                    <option value="2">维修时间</option>
                  </select>
                </div> -->
                <div class="top_module top_module_box" style="min-width: auto;">
                  <span class="top_module_label module_text">排序</span>
                  <select name="" class="top_module_select" [(ngModel)]="sortType" style="min-width: 110px;">
                    <option value="1">升序</option>
                    <option value="2">降序</option>
                  </select>
                </div>
                <div class="selectDate top_module">
                  <div class="input-daterange input-group s_selected_time_box s_hover_box">
                    <input type="text" [(ngModel)]='startTime' class="form-control s_selected_time" id="datetimepicker1"
                      autocomplete="off" placeholder="选择开始时间" />
                    <span class="s_selected_time_spe">至</span>
                    <input type="text" [(ngModel)]='endTime' class="form-control s_selected_time" id="datetimepicker2"
                      autocomplete="off" placeholder="选择结束时间" />
                    <div class="s_del_icon" (click)='del_date()'>x</div>
                  </div>
                </div>
                <button class="btn btn-primary" (click)="table_search()">查询</button>
                <!-- <button type="button" class="btn btn-primary" (click)="carWaitingRepairTop(waitingRepairModal)">车辆排名</button> -->
                <button type="button" class="btn btn-primary" (click)="exportData()" *ngIf="resourceExport">导出</button>
              </div>
              <div class="right top-search">
                <input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input"
                  placeholder="车牌号码、所属公司...">
                <span class="top-search-box">
                  <button class="top-search-btn" type="button" (click)="table_search()"> <i
                      class="fa fa-search"></i></button>
                </span>
              </div>
            </div>
            <div class="table_scroll">
              <table
                class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
                <thead>
                  <tr>
                    <th>设备ID</th>
                    <th>车牌号码</th>
                    <th>用途分类</th>
                    <th>安装厂区</th>
                    <th>故障状态</th>
                    <th>维修人员</th>
                    <th>维修时间</th>
                    <th>故障现象</th>
                    <th>维修内容</th>
                    <th>维修细分</th>
                  </tr>
                </thead>
                <tbody>
                  <tr *ngFor="let row of tableData">
                    <td>{{row.deviceId}}</td>
                    <td>{{row.carNumber}}</td>
                    <td>{{carTypeText[row.useTypeL2]}}</td>
                    <td>{{row.companyName}}</td>
                    <td>
                      <span *ngIf='row.repairedStatus=="0"' class="orange">待维修</span>
                      <span *ngIf='row.repairedStatus=="1"' class="green">已维修</span>
                    </td>
                    <td>{{row.repairedUserName}}</td>
                    <td>{{row.repairedTime}}</td>
                    <td>{{row.faultPhenomenon}}</td>
                    <td>{{row.repairContent}}</td>
                    <td>{{row.repairSubdivide}}</td>
                  </tr>
                </tbody>
              </table>
            </div>
            <div class="table-fix clearfix">
              <paginator [totalRecords]="totalCount" [rows]="pageSize" [currentPage]="curPage - 1"
                (onPageChange)="paginate($event)">
              </paginator>
              <button type="button" class="btn default refresh_btn" (click)="refresh()"><i
                  class="fa fa-refresh"></i></button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </sa-widgets-grid>
</div>